﻿{% extends 'base.html' %}

{% block extra_head  %}

<title>添加新文章</title>
<script type="text/javascript" src="/tinymce/tiny_mce.js"></script>
<script type="text/javascript">
    tinyMCE.init({
        theme : "advanced",
        mode : "exact",
        elements : "content",
        /*plugins : "bbcode",*/
        theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,styleselect,removeformat,cleanup,code",
        theme_advanced_buttons2 : "",
        theme_advanced_buttons3 : "",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "center",
        theme_advanced_styles : "Code=codeStyle;Quote=quoteStyle",
        /*content_css : "css/bbcode.css",*/
        entity_encoding : "raw",
        add_unload_trigger : false,
        remove_linebreaks : false,
        inline_styles : false,
        convert_fonts_to_spans : false
    });
    /*tinyMCE.execCommand('mceToggleEditor',false,'content');*/
    tags = {{env_tags|join:","}}
    /*
    $('#id_tags').keyup(function(){
        if(this.value.length > 0){
            l = this.value.split(',')
            w=l[l.length-1]
            if(tags.search(w)){
                s = tags.substr(tags.search(w))
                slen = s.search('.')
                end = tags.search(w) + slen
                start = tags.substring(0,end).lastIndexOf('.')
                this.value=tags.substring(start,end)
            }
        }
    });
    */

        
</script>
<style type='text/css'>
    form.model textarea{
        width:80%;
        height:300px;
    }
</style>

{% endblock %}

{% block content %}
<h2> 发布新文章 </h2>

<form class='model' action='/archive' method='POST'>
    {{form.as_p}}
    <input class='submit' type='submit' value='写好啦'></input>
</form>

{% endblock %}
